﻿<UserControl x:Class="CPPEI.Coolzon.UI.ColorSlider"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:extToolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
             mc:Ignorable="d" >
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="255"></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Column="0">
            <extToolkit:ColorCanvas x:Name="colorCanvas" Grid.Column="0"/>
            <Grid Height="45">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Border Grid.Row="0" BorderThickness="1" BorderBrush="Black">
                    <Canvas x:Name="colorGradient" Height="20" Width="255">
                    </Canvas>
                </Border>
                <StackPanel Orientation="Horizontal" Grid.Row="1">
                    <Button Style="{DynamicResource  ShortButtonStyle}" x:Name="btnLine" ToolTip="线性渐变" Click="btnLine_Click" Content="线 性" />
                    <Button Style="{DynamicResource  ShortButtonStyle}" x:Name="btnRadia" ToolTip="径向渐变" Click="btnRadia_Click" Content="径 向" Visibility="Collapsed"/>
                </StackPanel>
            </Grid>
        </StackPanel>
        <Grid Grid.Column="1" VerticalAlignment="Top" x:Name="gdGradientLine" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock Text="渐变起始点" Margin="20,0,0,0" VerticalAlignment="Center" />
            <TextBlock Text="渐变终点" Grid.Row="1" Margin="20,0,0,0" VerticalAlignment="Center" />
            <TextBlock Text="透明度" Grid.Row="2" Margin="20,0,0,0" VerticalAlignment="Center"/>

            <StackPanel Orientation="Horizontal" Grid.Column="1">
                <TextBox x:Name="tbStartPointX" Height="20" Width="100" Text="0.5" />
                <TextBox x:Name="tbStartPointY" Height="20" Width="100" Text="0"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1">
                <TextBox x:Name="tbEndPointX" Height="20" Width="100" Text="0.5" />
                <TextBox x:Name="tbEndPointY" Height="20" Width="100" Text="1"/>
            </StackPanel>

            <TextBox x:Name="tbOpacity" Height="20" Width="100" HorizontalAlignment="Left" Text="1" Grid.Column="1" Grid.Row="2"/>

            <Border Grid.ColumnSpan="2" Grid.Row="3"  BorderThickness="1" BorderBrush="Black">
                <Canvas Height="20" x:Name="canvasGradientLine" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Canvas>
            </Border>
        </Grid>
        <Grid Grid.Column="1" VerticalAlignment="Top" x:Name="gdRadiaLine" Visibility="Collapsed">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>

            <TextBlock Text="中心点" Grid.Column="0" Grid.Row="0" Margin="20,0,0,0" VerticalAlignment="Center" />
            <TextBlock Text="透明度" Grid.Column="0" Grid.Row="1" Margin="20,0,0,0" VerticalAlignment="Center"/>
            <TextBlock Text="水平半径" Grid.Column="0" Grid.Row="2" Margin="20,0,0,0" VerticalAlignment="Center"/>
            <TextBlock Text="垂直半径" Grid.Column="0" Grid.Row="3" Margin="20,0,0,0" VerticalAlignment="Center"/>
            <TextBlock Text="渐变起始点" Grid.Column="0" Grid.Row="4" Margin="20,0,0,0" VerticalAlignment="Center"/>

            <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="0" >
                <TextBox x:Name="tbRCenterX" Height="20" Width="100" Text="0.5"/>
                <TextBox x:Name="tbRCenterY" Height="20" Width="100" Text="0.5"/>
            </StackPanel>
            <TextBox x:Name="tbROpacity" Height="20" Width="100" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Text="1"/>
            <TextBox x:Name="tbRadiusX" Height="20" Width="100" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Text="0.5"/>
            <TextBox x:Name="tbRadiusY" Height="20" Width="100" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" Text="0.5"/>
            <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4" >
                <TextBox x:Name="tbOriginX" Height="20" Width="100" Text="0.5"/>
                <TextBox x:Name="tbOriginY" Height="20" Width="100" Text="0.5"/>
            </StackPanel>
            <Canvas x:Name="canvasGradientRadia" Grid.ColumnSpan="2" Grid.Row="5" Height="20" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
        </Grid>
    </Grid>
</UserControl>
